<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改分销商信息')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-distributor-edit" th:object="${jtDistributor}">
            <input name="distributorId" th:field="*{distributorId}" type="hidden">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">用户id：</label>
                    <div class="col-sm-8">
                        <input name="userId" th:field="*{userId}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">分销商名称：</label>
                    <div class="col-sm-8">
                        <input name="distributorName" th:field="*{distributorName}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">联系人：</label>
                    <div class="col-sm-8">
                        <input name="contact" th:field="*{contact}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">联系电话：</label>
                    <div class="col-sm-8">
                        <input name="countryCode" th:field="*{countryCode}" class="input-line" type="number" maxlength="5" style="width: 70px;" placeholder="国家码">
                        <span>-</span>
                        <input name="phoneNumber" th:field="*{phoneNumber}" class="input-line" type="number" maxlength="11" style="width: 120px;" placeholder="电话" >
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">邮箱：</label>
                    <div class="col-sm-8">
                        <input name="email" th:field="*{email}" class="form-control" type="text" maxlength="100">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">公司名称、姓名：</label>
                    <div class="col-sm-8">
                        <input name="licenseName" th:field="*{licenseName}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">公司法人：</label>
                    <div class="col-sm-8">
                        <input name="corporation" th:field="*{corporation}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">证件号码：</label>
                    <div class="col-sm-8">
                        <input name="licenseNo" th:field="*{licenseNo}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">证件图片1：</label>
                    <div class="col-sm-8">
                        <input name="licenseImage1Url" th:field="*{licenseImage1Url}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">证件图片2：</label>
                    <div class="col-sm-8">
                        <input name="licenseImage2Url" th:field="*{licenseImage2Url}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">说明：</label>
                    <div class="col-sm-8">
                        <input name="description" th:field="*{description}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">备注：</label>
                    <div class="col-sm-8">
                        <input name="remark" th:field="*{remark}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">审核状态：</label>
                    <div class="col-sm-8">
                        <div class="radio-box" th:each="dict : ${@dict.getType('jt_audit_status')}">
                            <input type="radio" th:id="${'auditStatus_' + dict.dictCode}" name="auditStatus" th:value="${dict.dictValue}" th:field="*{auditStatus}">
                            <label th:for="${'auditStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">审核人：</label>
                    <div class="col-sm-8">
                        <input name="auditBy" th:field="*{auditBy}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">审核时间：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <input name="auditTime" th:value="${#dates.format(jtDistributor.auditTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">审核原因：</label>
                    <div class="col-sm-8">
                        <textarea name="auditReason" class="form-control">[[*{auditReason}]]</textarea>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">佣金比例：</label>
                    <div class="col-sm-8">
                        <input name="commissionRate" th:field="*{commissionRate}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">货币：</label>
                    <div class="col-sm-8">
                        <input name="currency" th:field="*{currency}" class="form-control" type="text">
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "business/distributor";
        $("#form-distributor-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-distributor-edit').serialize());
            }
        }

        $("input[name='auditTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>